<template>
  <div class="userCookbookItem" @click="toCookbook">
    <div class="show" :style="{ backgroundImage: `url(${item.r.p})` }"></div>
    <div class="buttom">
      <div class="seen">{{ item.r.recommend_label }}</div>
      <div class="name">{{ item.r.n }}</div>
    </div>
  </div>
</template>

<script setup lang="ts">
import router from "@/router";

const props = defineProps(["item"]);

const toCookbook = () => {
  // console.log("toCookbook");
  router.push({
    path: "/cookbook",
    query: { id: props.item.r.id, user_id: props.item.r.a.id },
  });
};
</script>

<style lang="scss" scoped>
.userCookbookItem {
  // margin-bottom: 20px;
  padding-bottom: 50px;
  cursor: pointer;

  .show {
    width: 100vw;
    height: 210px;
    background-size: 100%;
    background-position: center center;
    background-repeat: no-repeat;
    margin-bottom: 10px;
  }

  .buttom {
    padding: 0 15px;
    display: flex;
    flex-direction: column;

    .seen {
      font-size: 14px;
      font-weight: bold;
      margin-bottom: 5px;
    }

    .name {
      font-size: 16px;
    }
  }
}
</style>
